/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package listeners;

import java.util.Date;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * Web application lifecycle listener.
 *
 * @author HAYBERT1
 */
public class ListenerFecha implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent se) {
        Date d = new Date();
        //accedemos a la sesion a través del objeto se.getSession()
        se.getSession().setAttribute("fechahora", d);
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
